package com.pinghua.mocha.basics.enumerate.fwct;

import com.coffee.core.CoffeeEnum;

public enum WarningTypeEnum implements CoffeeEnum<Integer> {
    Merchants(1,"商户端预警"),

    Recycle(2,"收运端预警"),

    Disposal(3,"处置端预警"),

    Illegal(4,"违法预警");
    private final Integer code;
    private final String label;

    WarningTypeEnum(Integer code, String label) {
        this.code = code;
        this.label = label;
    }

    @Override
    public Integer code() {
        return this.code;
    }

    @Override
    public String label() {
        return this.label;
    }


    public static WarningTypeEnum ofCode(Integer code) {
        for (WarningTypeEnum type : values()) {
            if (type.code.equals(code)) {
                return type;
            }
        }
        return null;
    }
}
